﻿@page "/Account/Login"

@using Microsoft.Extensions.Options;
@using Microsoft.JSInterop
@using YiMeiJiaLibModel.Config;
 
<div ontouchstart="" id="login-body">

    <header class="demos-header">
        <h1 class="title">
            <img src="@ApiConf.CND/Images/Icon/logo2.png" id="img-log"  />
        </h1>
    </header>
    <form>
        <div class="item">
            <input type="text" name="name" maxlength="11" placeholder="请输入您的手机号" autocomplete="off" class="name" id="mobile" @bind="mobileNumber">
        </div>
        <div class="item">
            <input type="text" name="vcode" maxlength="6" placeholder="请输入验证码" autocomplete="off" class="vcode" @bind="inputCode">
            <span id="vcode" @onclick="SendCode">@codeBtnTxt</span>
        </div>
        <div class="submit"><button @onclick="SubmitLoginAsync"  type="button" >登&nbsp;陆</button></div>
    </form>
    <div class="footer">
      
        <p>
            登录使用就表示同意
            @{
                var xy = "用户协议";
                var ys = "隐私保护政策";
            }
            <a href="javascript:;" class="open-popup" data-target="#full" @onclick="()=>GetDataAndPop(xy)">用户协议条款</a>
            和
            <a href="javascript:;" class="open-popup" data-target="#full" @onclick="()=>GetDataAndPop(ys)">隐私</a>
            政策
        </p>
    </div>

 @*    协议弹窗 *@

    <div id="full" class="weui-popup__container" style="display: none;">
      <div class="weui-popup__overlay"></div>
      <div class="weui-popup__modal">
        <header class="demos-header">
          <h2 class="demos-second-title" id="Xtitle">@_XTitle</h2>
       
        </header>
        <article class="weui-article" id="XContent">
                @if(!string.IsNullOrEmpty(_XConten)){
                    var content = _XConten;
                    content.Replace("\r\n", "<br />");

                    @content
                }
        </article>
        <a href="javascript:;" class="weui-btn weui-btn_primary close-popup">关闭</a>
      </div>
    </div>


</div>
<script>
    var send_time = 0;
    $(document).ready(function () {
        $('.weui-tabbar').hide();
    });
    // 短信倒计时
    function time_c() {
        if (send_time >= 0) {
            send_time--;
            $('#vcode').html(`${send_time}秒新发`);
            window.setTimeout(function () { time_c(); }, 1000);
            return 0;
        } else { $('#vcode').html(`重新发送`); return 0; }
    }
    // 检查倒计时
    function _CheckTime() {
        if (typeof (send_time) !== 'undefined' && send_time > 0) {
            return send_time;
        } else {
            return 0;
        }
    }

   
    
</script>
@code{

}